package io.kiki.sba.registry.server.metadata.lease;

import io.kiki.sba.registry.common.model.Node;
import io.kiki.sba.registry.common.model.metaserver.Lease;
import io.kiki.sba.registry.common.model.metaserver.cluster.VersionedList;


public interface LeaseManager<T extends Node> {

    /**
     * Renew Lease. Return true if the renewal has been existed and renew works Return false if the
     * renewal is a new entry, we have to register it insteadof renew it
     */
    boolean renew(T renewal, int leaseDuration);


    Lease<T> getLease(T renewal);


    VersionedList<Lease<T>> VersionedLeaseList();
}
